package hoang.hut.networkdemo.network.json;

/**
 * day la lop parser json tu server
 * 
 * @author hoangnv
 *
 */
public class ParserJson {
	
	/**
	 * parser location list
	 * 
	 * @param object
	 * @return
	 * @throws JSONException
	 */

	/*public static ArrayList<TripInfo> parserLocationList(JSONObject object) throws JSONException{
		
		ArrayList<TripInfo> arrayList = new ArrayList<TripInfo>();
		
		*//**
		 * "info":[
			    {
			        "loc_id":"107",
			        "loc_name":"Alton",
			        "toll_road":1",
			        "road_name":"241/261/133"
			    },
		 *//*
		
		JSONArray arrayTrip = object.getJSONArray(WebServiceConfig.PARAM_INFOR);
		for (int i = 0; i < arrayTrip.length(); i++) {
			JSONObject objectTrip = arrayTrip.getJSONObject(i);
			TripInfo infor = new TripInfo();
			
			infor.setLoc_id(objectTrip.getString(WebServiceConfig.PARAM_LOC_ID));
			infor.setLoc_name(objectTrip.getString(WebServiceConfig.PARAM_LOC_NAME));
			infor.setRoad_name(objectTrip.getString(WebServiceConfig.PARAM_ROAD_NAME));
			infor.setToll_road(objectTrip.getString(WebServiceConfig.PARAM_TOLL_ROAD));
			
			arrayList.add(infor);
		}
		
		return arrayList;
	}*/
	
	
}
